﻿//------------------------------------------------------------------------------
// 创建标识: Copyright (C) 2008 Socansoft.com 版权所有

// 创建描述: SocanCode代码生成器自动创建于 2008-10-15 15:36:14
//
// 功能描述: 
//
// 修改标识: 
// 修改描述: 
//------------------------------------------------------------------------------

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Controls_RETURNDOCListControl : System.Web.UI.UserControl
{
    public event RepeaterCommandEventHandler ItemCommand;
    public List<string> Selected
    {
        get
        {
            List<string> l = new List<string>();
            foreach (RepeaterItem item in rptRETURNDOC.Items)
            {
                CheckBox cb = item.FindControl("chkChoose") as CheckBox;
                if (cb != null && cb.Checked)
                {
                    HiddenField fld = item.FindControl("hfORDERDOC") as HiddenField;
                    if (fld != null)
                    {
                        string id = fld.Value;
                        l.Add(id);
                    }
                }
            }
            return l;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    public void Bind(DataSet l)
    {
        rptRETURNDOC.DataSource = l.Tables[0].DefaultView;
        rptRETURNDOC.DataBind();
    }

    protected void rptRETURNDOC_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (ItemCommand != null)
            ItemCommand(source, e);
    }
    protected void rptORDERDOC_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            string odid = ((HiddenField)e.Item.FindControl("hfORDERDOC")).Value;
            DataSet ds = new BLL.RETURNNOTE().GetOrderNoteById(odid);
            if (ds.Tables[0].Rows.Count > 0)
            {
                HyperLink hl = (HyperLink)e.Item.FindControl("sdss");
                System.Drawing.Color a = System.Drawing.Color.FromName(ds.Tables[0].Rows[0]["ST_COLOR"].ToString().Trim());
                hl.BackColor = a;
                hl.ToolTip = ds.Tables[0].Rows[0]["RN_NOTE"].ToString();
            }
        }

    }
}
